package acm.同步赛4;

import java.util.Scanner;

public class C  {
    //左侧空格=n-i-1
    //每行个数=1+i*2    //i从0开始
    //焦黑部分=
    //鱼尾=n/2
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        for (int i = 0; i < n; i++) {
            print(n,i,k);
        }
        for (int i=n-2;i>=0;i--){
            print(n,i,k);
        }
        for (int i=1;i<=n/2;i++){
            print(n,i,k);
        }
    }
    public static void print(int n,int i,int k){
        for (int j = 0; j < n-i-1; j++) {
            System.out.printf(" ");
        }
        for (int j = 0; j < 1+i*2; j++) {
            System.out.printf(j<k?"#":"^");
        }
        System.out.println();
    }
}
